The invention relates to the field of executing software code in a reserved and protected area.
Conventional digital control systems in most cases include one central processor and memory, wherein the processor is the central element of the digital control system. The processor is the main computing unit of the digital control system and executes the program code, i.e. digital system control algorithms and/or programs defining the system behaviour. That is control algorithms and programs control the processor and include the commands to be executed by the processor as required by the program's purpose. The program is stored in the memory.
In this context the term program is used to describe executed software code, wherein the software may be executed in one instance or in more that one instance at the same time as so called tasks. Executed programs or tasks may be based on identical source code, but are executed in separate operation environments, i.e. each task has individually assigned resources such as memory, unless the executed programs or tasks intentionally access a shared resource. In the following the terms executed program or shortly program are used.
As there is only one processor in the system it has to coordinate the operation of various internal and peripheral system units. For controlling the system units the processor may execute more than one program at a time, wherein different vendors may provide the programs. As the one processor actually cannot execute two or more programs simultaneously, a time-sharing or time multiplexing method is used, which manages the processor to execute the different programs in consecutive short time slices, thus emulating a simultaneous execution.
Ideally each program executed in parallel to another should be programmed not to interfere with other programs, such that these may be executed in parallel. Although programs are tested thoroughly before put into production, there remains a slight risk that they do not behave as intended. However when these programs are developed and tested they usually are executed alone or in parallel to other programs on a system, but not always in exactly the same environment and operating conditions as in production. Hence the digital control system, for example, the operating system of the digital control system, should take care that a program executed in a time slice of a time multiplexing system leaves the environments, i.e. the resources associated with parallel executed programs, untouched. In one embodiment, a program currently executed should not read from a memory area assigned to a program, which is currently suspended.
In one conventional approach for providing an execution environment to a program all memory addresses are virtual memory addresses, which are translated into real memory addresses based on an individual task identifier. A translation table is set up in order to grant exclusive access to a memory range not shared between parallel executed programs, wherein the translation table for example requires registers specifying start and end of a protected memory range and a protected register stores the identifier of a program or task. This mapping of virtual to real memory addresses conventionally is performed by a memory management unit (MMU). Another conventional approach is the memory protection register. Similar to a MMU a set of registers describes start and end of a protected memory range and an individual identifier is used to separate between different programs executed in parallel, but there is no translation of virtual to real memory addresses.
Both above described solutions require additional registers for task/program management. Hence a novel method requiring fewer resources is needed.